Hybrid off-grid energy systems optimal sizing with integrated hydrogen storage based on deterministic balance approach

The transition to sustainable power infrastructure necessitates integrating various renewable energy sources efficiently. Our study introduces the deterministic balanced method (DBM) for optimizing hybrid energy systems, with a particular focus on using hydrogen for energy balance. The DBM translates the sizing optimization problem into a deterministic one, significantly reducing the number of iterations compared to state-of-the-art methods. Comparative analysis with HOMER Pro demonstrates a strong alignment of results, with deviations limited to a 5% margin, confirming the precision of our method in sizing determinations. Utilizing solar and wind data, our research includes a case study of Cairo International Airport, applying the DBM to actual energy demands.

Hybrid off-grid systems, designed for longevity, possessed inherent complexities.Notably, integrating hydrogen as an energy storage solution amplified the challenges related to system sizing.While hydrogen offered remarkable energy density and could be produced from renewable sources, its high levelized cost of energy (LCOE) necessitated meticulous optimization to bring down the overall system LCOE.Batteries had been a predominant choice in hybrid systems, but the allure of hydrogen storage as a sustainable alternative was undeniable.Still, the harmonious interplay between wind and solar PV systems mitigated their energy production shortfalls, enhancing the system's comprehensive reliability.Increasingly, these hybrid energy configurations were seen as the vanguard for sustainably powering remote and off-grid regions.Research conducted in 1 described the design information of solar PV and wind turbine hybrid power generation systems to provide electricity to a model community of 100 households and a health clinic and elementary school.The optimal simulation results in this study showed that solar PV/wind turbine/diesel generator/battery and converter was the best-configured system for their application with a renewable fraction of 84%.Many research papers have introduced different system configurations and comparative analysis for deciding the most economically feasible one.One of these researches in 2 presented a case study in the desert region of the United Arab Emirates.This study introduced a technical-economic analysis based on integrated modeling, simulation, and optimization approach to design an off-grid hybrid solar PV/FC power system.This system was designed to meet the residential community's energy demand of 4500 kWh/day (150 houses).The total power production from the distributed hybrid energy system was 52% from the solar PV and 48% from the FC with a 40.2% renewable fraction, which was a low value for the renewable energy penetration of this system.Consequently, one of the main concerns of our paper is how to achieve a renewable fraction of 100% in the simulated configurations of various hybrid off-grid systems.These given numbers of renewable fractions are used to provide a rough estimate for the previous research that focused on the penetration of renewable resources (increasing the renewable fraction percentage) and selecting the best configuration for the application targets.
Another approach for choosing the best size and location for off-grid hybrid systems was presented by 3 .They considered economic, technical, social, and environmental factors to discover the ideal capacity and location for continually meeting the load while reducing LCOE and overall life cycle cost.The hybrid algorithm based on the geographic information system, simulated annealing, and enhanced harmony search was evaluated with real data sources, load demands, and electric vehicle aspects, adding robustness but increasing resource and storage needs, thus raising costs.They applied an advanced Grey Wolf Optimizer combined with the Sine Cosine Algorithm for better convergence and stability.The research highlights the ongoing challenge of balancing efficiency and cost-effectiveness in renewable energy systems, especially given inherent uncertainties, suggesting the need for more sophisticated optimization strategies.
Figure 1 provides a visual taxonomy of optimization methods used in energy system sizing, classified by their nature and complexity.It illustrates a spectrum ranging from deterministic approaches like linear programming (LP), nonlinear programming (NLP), integer linear programming (ILP), and dynamic programming (DP), to nature-inspired and metaheuristic algorithms such as genetic algorithm (GA), particle swarm optimization (PSO), and ant colony optimization (ACO).The complexity gradient, denoted by the color bar, indicates that deterministic methods, while established earlier, tend to offer lower complexity relative to the more recent www.nature.com/scientificreports/metaheuristic or nature-inspired methods.This suggests that deterministic methods, despite their simplicity, remain a robust choice for energy system optimization, especially in scenarios where computational efficiency and the guarantee of reaching an optimal solution are paramount.
Our study, as outlined in Table 1, addresses significant gaps in renewable energy system (RES) sizing optimization literature.It uniquely combines a deterministic methodology with hydrogen system sizing and computational efficiency, a combination not extensively explored in previous research.Our approach involves detailed 1-year simulations across diverse system configurations shown in Fig. 2, offering a comprehensive view of RES performance.A distinct feature of our research is the theoretical analysis of optimality, which, alongside thorough techno-economic assessments, provides deeper insights into RES optimization.Further, our findings are validated with commercial software.

Solar photovoltaic (PV) model
The main objective functions are used to get the output power of the PV modules taking into consideration the efficiency of the modules and other derating factors.The first equation used in PV modeling is an output power function of irradiance 13 .
Other factors that have been encountered during the literature review.Temperature and wind speed have significantly affected the model to get more accurate results feasible for execution.Consequently, another objective function for calculating the output power is evolved, providing a relation between the irradiance and temperature to deliver the actual output power shown in the equation 14 . (1) Table 1.Comparison of research papers on RES sizing optimization.www.nature.com/scientificreports/After studying the behavior of temperature and irradiance throughout the meteorological model, the effect of this behavior is linked to the changes in each of the two parameters and the overall efficiency of the PV system 14 .The following equation supports this relation.
Numerous factors prohibit solar PV arrays from operating at maximum efficiency.In addition to voltage drop and dust accumulation, one of these factors is the operating temperature of the solar PV module, which can contribute considerably to the most significant proportion of power loss.The effect of temperature on output varies by module and can be calculated using the temperature coefficients supplied on the manufacturer's data sheets and the following relationships.
In this model, it is assumed that AC losses are fixed at roughly 7% while array temperature losses range between 5 and 11% depending on the monthly temperature profile for theexample shown in Table 2.

Wind turbine generators
The wind turbine generator (WTG) hourly power output, at the studied location, depends on the hourly wind speed as shown in Fig. 3.It can be expressed by following equations 15 .
(2) We analyze the site's wind conditions and match them with the desired turbine characteristics to select the appropriate wind turbine model for a specific location.Using computational tools, we determine the optimal rated speed and the cut-in and cut-out speed limits.With these parameters defined, we consult a comprehensive database of available wind turbines 16 to find a model that aligns with our requirements.We further refine our selection based on site-specific restrictions, such as height limitations.

Hydrogen system
FC can be defined as an electrochemical device that produces electrical power directly from a fuel like hydrogen, natural gas, diesel, or propane.Its operation is similar to that of a conventional battery except for some parts that will be discussed in detail later in this paper and will affect the modeling of the hybrid off-grid system.Accordingly, their development has been much related to the development of electrochemistry more than power engineering, and it is already studied as a distinct branch of physical chemistry 17 .The second element in the hydrogen system is the ELZ, an electrochemical device that makes electrolysis for the water molecules to produce hydrogen and oxygen.The excess electrical in the system powers this process.In other words, ELZ is used to convert unused electrical energy into stored chemical energy inside hydrogen and then recall it back in the time of operation.The mathematical formula of the produced hydrogen can be expressed as follows 18 .
The sizing of the hydrogen storage system takes place after determining the maximum energy generation from the PV, WTGs, and the minimum load power.The ELZ utilizes surplus energy to produce a maximum of 23 kg of hydrogen per hour.Consequently, the hydrogen tank size is determined to have a maximum capacity of 100 kg, representing the upper safe limit the hydrogen might reach during the year.To decrease the volume of a gas at constant temperatures, one can increase its pressure.Under such high pressure, a 125-l tank can store 5 kg of hydrogen.Currently, most car manufacturers opt to store hydrogen in gaseous form at high pressure.This technology allows a FC-powered car to cover between 500 and 600 km between fill-ups, as referenced in 19,20 .The Model H15T4X200 21 compresses hydrogen in each 10 kg tank to 345 bar.The system configuration includes ten compressors paired with ten hydrogen tanks, plus an additional tank for excess hydrogen storage.As a result, the total hydrogen storage capacity stands at 100 kg, maintained at a constant pressure of 345 bar.This system connects to 10 compressors via pipelines, ensuring the pressure for hydrogen storage and transport.

Load profile system
In this study, it is assumed that the DC and AC wiring losses are small enough to be neglected due to the small geographic scatter of the study system.The reliability test system (RTS) load profile is used in this study 22 as shown in Fig. 4, and the peak load is set to 250 kW.The load profile is then determined per hour for the 8760 h of a year.

Economic investigation for the studied system
The economic evaluation of hybrid renewable energy systems is pivotal, specifically assessing LCOE, capital costs, and cash flows to determine project viability.LCOE represents the unit cost of electricity over the system's lifespan, while the net present cost (NPC) reflects the discounted total of all expenses incurred throughout the project's life.These financial metrics are critical for investors considering funding such ventures, especially in remote areas.
A detailed cash flow analysis elucidates operational, maintenance, and, where applicable, fuel costs.The discount factor, distinct from inflation, adjusts future costs to present-day values, with the real discount factor accounting for inflationary effects.The capital recovery factor (CRF) translates NPC into an equivalent annual cost influenced by inflation and project duration.These economic indicators form the foundation for optimizing techniques to minimize costs and achieve the most economical system configuration 23 .To optimally design the hybrid generation system, the optimization problem, defined by equation below as in 23 , is solved using any of the mentioned optimization techniques in the paper.
To minimize the total cost function, The economic model of the studied system is studied for the lifetime of the system using the following equations:

Methodology procedures
The use of DBM requires determining solar PV output power, ELZ size, FC size and hydrogen tank efficiency models.The accuracy of the solar PV model is crucial since it will be used to guide the overall layout of the system.To use the DBM, it is necessary to balance the energy need to offset the time of zero solar PV output hour (usually at night) with the energy produced net by the solar PV (during sun hours after being absorbed through the load).Hydrogen tanks will store this surplus energy until needed; at this point, FCs will convert it to meet the day's energy needs.Power generated by solar PV and required by the load through FCs is determined using the Area under graphs, as illustrated in Fig. 5, which are computed using the trapezium rule.A discrete optimization is performed to determine how many solar PV modules would be ideal for striking this equilibrium.In the first ( 13)  stage of the DBM design process, N solar PV modules would be sufficient to meet the required load and provide excess power at the end of the day.To begin computing energy Production values, this is founded on a random guess.This initial estimate is based on the energy balance equation discussed in the prior work 24 and is performed to estimate the surplus power supplied by solar PV to compensate for the time of zero PV output power completely.Using the data from NASA and METEONORM 25,26 , the output solar PV power is calculated using equations in the section of modeling of solar PV based on the irradiance profile of a specific day.Throughout the entirety of the model, the method of calculating energy production by obtaining the Area under curves is the primary method employed.Numerous methods for calculating the Area under curves, including the trapezium rule and the integration of curve functions in MATLAB.This model uses the trapezium rule to calculate the area under curves in a 1-h time step because it is challenging to obtain the function of each curve so that it can be integrated.In addition, the accuracy of the trapezium rule is deemed acceptable with minimal error ranges.
As shown in Fig. 6, the Area under the curve is calculated for the E + , E − , and E D .
(24) E −,1 = (P l − P pv ) dt, for t s,1 < t < t e,1 , where P pv < P l  www.nature.com/scientificreports/E + has to be equal or greater than E − to ensure the energy balanced operation.
Our target is to find the optimal sizing of N PV as follows: Figure 7 depicts the computation of the optimal number of solar PVs.For Eq. ( 28), we iteratively compute the number of PVs, denoted as N PV , given the energy provided by each PV module, E 1 .This calculation is grounded on the premise that these values represent the maximum energy required by the load during nighttime hours.The goal is to achieve an optimal surplus of solar PV power capable of covering the load, taking into account the efficiencies of the FC and the hydrogen tank.
Furthermore, it is observed that the surplus energy supplied by the solar PV modules must surpass the nighttime discharge power by a specific margin.This surplus predominantly hinges on the efficiency of the fuel cell, electrolyzer, and hydrogen tank.As such, system components with higher efficiency tend to yield better sizing optimization results.Equation ( 29) elucidates the influence of system component efficiencies on the surplus energy supplied and serves as a constraint for the optimization strategy.
E D,1 and E D,2 resemble the energy the load consumes via solar PV modules during the first hours between sunset and sunrise.In previous calculations, these two values should have been taken into account.In our system, E − represents the energy available to the ELZ.The hydrogen production, H 2 , is governed by Eqs. (11)nd ( 12), derived from the energy supplied by E − .Subsequently, the produced H 2 serves as the primary input for the FC.The sizing or rating of the FC is directly determined based on the volume of hydrogen generated by the ELZ.Nevertheless, it is essential to analyze the system efficiency, as they will account for the losses that occur during the conversion process via hydrogen tanks and FCs.After determining the optimal sizing of the system components, we proceed to calculate the annual energy production.This calculation is grounded in the operational characteristics of each component, as described by the subsequent equations.It is essential to note that the performance of each component directly influences the overall system's energy output.By integrating these operational equations over the year, we obtain an accurate representation of the system's annual energy production capabilities.
It is essential to note that, despite the method designation, the DBM does not prioritize addressing uncertainties.Instead, it is engineered primarily to tackle the sizing dilemma of hybrid energy systems deterministically.Interestingly, DBM focuses on determining the optimal size analytically, operating much in the vein of MILP solvers.However, its augmented flexibility sets it apart, allowing users to adjust sizing parameters based on seasonal variations they input.One of its distinctive advantages is its capability to reduce the iteration counts typically required and deliver a feasible solution.Such a solution could be computationally burdensome when sought through other heuristic methods.This section presents the methodology for calculating the optimal number of solar PV modules.Using this framework, one can similarly ascertain N W the ideal number of wind turbines.By employing data analysis and performance metrics, this approach ensures optimal energy output and system efficiency.

Global optimality and computational complexity analysis
The objective function N PV is a linear function of E + and E D , as E 1,PV is constant.A linear function is convex.To establish this, consider two arbitrary values E +,1 , E +,2 and E D,1 , E D,2 representing the energy values on two different times of the day, and any such that 0 ≤ ≤ 1 .The objective function must satisfy: Given E 1,PV is constant, we can simplify the above to: This confirms the convexity of the objective function.The constraints involve integrals of the difference between measured values P l and P pv , which form a set of linear equations.Linear equations define a convex set.The energy balance constraints can be expressed as linear inequalities, which also define convex sets.Therefore, the optimization problem, which aims to determine N PV such that the energy produced matches or exceeds the energy demanded, is convex.Since the objective function is convex and the feasible region defined by the constraints is a convex set, any local minimum found in this optimization problem is also a global minimum.
(25) E −,2 = (P l − P pv ) dt, for t s,2 < t < t e,2 , where P pv < P l (26) E + = (P pv − P l ) dt, for t s,+ < t < t e,+ , where P l < P pv (27) E D = P l dt, for 0 < t < t e , where P l < P pv (28) The non-triviality of this optimization problem arises from the computational complexity involved in integrating measured values of power to obtain E + and E D for each hour across an entire year.The integrals do not have closed-form solutions and must be numerically evaluated.The computational complexity of the DBM algorithm is given by O(m) , with m being the number of iterations until the energy balance is achieved.The algorithm's steps and their complexities are as follows: 1. Calculate the energy output for a single PV module, E 1,PV , which is a constant.This is an O(1) operation.2. In each iteration i , the cumulative energy E + i and the demand E D i are computed.These are based on predetermined measurements, the complexity is O(1) per iteration.

The iteration proceeds until the condition E +
i ≥ E Load + E sys,losses is met.Thus, the loop runs m times, where m is the smallest integer satisfying the energy balance.4. The integral computation within each iteration has a polynomial complexity with respect to the number of data points; however, since it is a single operation per iteration, it does not affect the overall linear complexity.
The overall complexity is modeled by the equation: This equation demonstrates that the primary factor determining complexity is the number of iterations m , leading to a linear computational complexity of O(m) .The algorithm is efficient as it avoids unnecessary com- putations beyond the point of achieving an energy balance, ensuring minimal computational burden.

Sizing methodology of hybrid solar PV/hydrogen system: case study 1
Applying DBM for the system sizing Our previous research derived the optimal sizing for the specified system using DBM.The finalized system comprised a total of N PV = 5400 panels.Alongside this, the system configuration included FC with a capacity of 300 kW, ELZ with capacities of 800 kW and 1000 kW, respectively, and a hydrogen ( H 2 ) tank with a storage limit of 100 kg.The efficacy and specifications of this model were compared with the system advisor model (SAM).For a detailed understanding of the model and its derivations, readers are referred to our earlier publication 24 .
In analyzing the annual system behavior for the examined location of Cairo International Airport, the production and energy consumption are investigated (same data as in 24 ) using the DBM method.From October to March, hydrogen consumption exceeds production, and solar energy is the sole source of hydrogen production.During April through September, solar energy increases due to increased irradiance and moderate temperature ranges, causing hydrogen production to exceed consumption.The entire year's excess solar electricity is stored in a hydrogen tank, yielding approximately 2000 kg of hydrogen that will be exported to the grid upon application of the power management method during January and December, when there is no surplus power and end consumers consume all produced energy.As shown in Fig. 7 and Table 3, the net energy produced by solar PV modules (considering temperature losses that are mentioned in previous section) is sufficient to cover the load demand for each month except for December that is considered as the worst-case scenario.The solar PV contribution in that energy mix is found to be 50% or exceeding depending on the month of the year and this what proves the capability of the DBM for optimizing the generation and meeting the load requirement.In December, there is a lack of generation around 5% which are supplied by the stored hydrogen from the excess of the previous months.Finally, energy profiles for solar PVs, FC, ELZ and hydrogen production are deduced using DBM for 8760 h as shown in Fig. 8.
Referring to cost equations in the modeling section and system cost per 1 kW as illustrated in Table 5, the economic model of the hybrid system is computed as shown in Table 4 and Fig. 9. Consider Electrical selling price (ESP) = 0.0788 USD/kWh 27,28 , project lifetime = 25 years, annual discount rate = 10% and assuming no decommissioning cost paid.Net present cost is negative, indicating that the project will not be profitable with    www.nature.com/scientificreports/ the current selling prices for Solar PV plants announced by the government.The tariff prices will drastically increase if the hydrogen system is used as an energy storage system.
Evaluation using HOMER tool HOMER-Pro 29 is an advanced optimization model that conducts numerous simulations to determine the optimal system design.The PV/FC configuration, as depicted in Fig. 10, is simulated for Cairo International Airport using a yearly load profile provided in 24 .The simulation is executed on an HP laptop with an Intel®Core TM i5 CPU at 2.20 GHz and 4.00 GB of RAM.Detailed specifications of the hybrid system components are illustrated in Table 6, where data has been collected from commercial datasheets during the selection process.An optimization analysis determines the most efficient hybrid power system configuration that satisfies the set constraints at the minimal net present cost using the cycle charging control (CC).HOMER has three primary controllers: cycle charging, combined dispatch, and load following.Cycle charging is the most suitable for this application because it optimally employs the hydrogen system.In contrast, the other controllers do not incorporate the ELZ and hydrogen tank in their simulations.The hybrid power system derives its electrical production primarily from the solar PV system, contributing 76.2%, and the Genset (fuel cell), providing 23.8%, or 748,235 kWh/year.This represents a 100% renewable fraction.The hybrid system caters to the AC primary load, which is 1,582,615 kWh/year (58% of the total production).Additionally, the ELZ consumes 1,063,082 kWh/year (42%) from the hybrid system for hydrogen production, with a 214 kWh/year surplus.Consequently, the unmet electrical demand by Solar PV-the primary power source-stands at 235,003 kWh/year.The system also generates an excess electricity of 366,370 kWh/year.This data plays a pivotal role in determining the hybrid system's reliability.To corroborate these results, HOMER Pro creates energy profiles for the solar PV, FC, ELZ, and hydrogen tanks, as depicted in Fig. 11.The operational ranges are 0-1800 kW for Solar PV, 0-250 kW for the FC, and 0-700 kW for the ELZ.These findings align with the operational ranges derived from the DBM method, as illustrated in Fig. 8.However, a deviation appears in the hydrogen tank storage, which fluctuates between 5 0 and 200 kg, differing from the DBM results.This discrepancy arises from the lack of an effective power management controller as in 30 that streamlines hydrogen production while avoiding undue stress on the hydrogen tanks, as evident in Fig. 11(e) with a significant portion of the regions appearing red during the summer.

Sizing methodology of solar PV/wind/hydrogen system: case study 2
Applying DBM for the system sizing This study analyzes various hybrid renewable energy scenarios, focusing on different combinations of WTGs and solar PV systems.We start with a 250 kW WTG and increase its capacity in 250 kW increments to 750 kW.Simultaneously, we assess each WTG level's required solar PV contribution to ensure balanced power generation.Our analysis identifies January as a critical month due to its lack of surplus energy.Using this information, we optimize system sizing and energy output predictions for January using the DBM approach.The results in Fig. 12 illustrate the various configurations between solar PV and WTGs.
System in Fig. 12c is found to have the highest annual energy production with a higher ratio of solar PV installed capacity compared to the installed wind turbine.As a result, this system is used in this paper for full simulation for 8760 h using DBM and conducting energy profiles for all system components, as shown in Fig. 13.

Sensitivity analysis
Sensitivity analysis plays a pivotal role in understanding the intricacies of system design, specifically in determining how the ideal composition of components shifts in response to parametric fluctuations over a system's lifespan.Figure 14 presents surface plots that depict variations in solar PV array capacity and wind turbine quantity related to primary load adjustments.For a more narrowed focus, we consider two specific sensitivity cases: the installed capacities of solar PV and wind turbines.Meanwhile, we maintained the other two variables-load and price-at a constant, pegging them at 100%, and analyze the outcomes within the context of the maximum renewable fraction.
Consider ESP = 0.0788 USD/kWh 27,28 , project lifetime = 25 years, annual discount rate = 10% and assuming no decommissioning cost paid.Additionally, a sensitivity analysis is conducted as shown in Fig. 15 and Table 6 for studying the effect of ratio between solar PV and wind installed capacity on the LCOE.
Simulation of HOMER is conducted for 8760 h, as shown in Fig. 16, to deduce the operation profiles of FC, solar PV, wind turbine, and hydrogen tanks, respectively.This section provides an in-depth comparative analysis between standalone solar PV systems, standalone WTG, and their hybrid combination.This comparison delves into critical metrics, including system sizing capacities, LCOE, and annual energy production.The computational efficiency of different sizing methods varies considerably.When using HOMER for optimization, the time complexity can be significant, with case 2 requiring up to 14 h and case 1 taking approximately 6 h.The duration largely depends on the search space associated with each component size.In contrast, the DBM method demonstrates a much more streamlined approach.It iteratively arrives at the optimal sizing of components and their modes of operation within a broader search space in just a fraction of the time.Specifically, DBM computations can conclude in mere minutes.
Based on the comparison and cost analysis study conducted in Fig. 17, hybrid solar PV/Wind with high penetration of solar PV modules, which corresponds to the lowest LCOE, is selected for implementation in the site of Cairo International Airport to supply the community load of 250 kW peak.These figures demonstrate the close alignment in annual energy production between the two methods.Despite differing in installed capacity setups, our approach notably outperformed HOMER regarding LCOE across all configurations.This comparison uses identical model parameters and input data to ensure a fair and accurate evaluation.It is observed that HOMER favors wind energy penetration rather than solar PV.However, this penetration affects the utilization of the installed wind turbines, resulting in a lower capacity factor for the turbines.

Figure 1 .
Figure 1.Methods used for solving the sizing optimization of energy systems.(Source: self painted by the author).

Figure 2 .
Figure 2. Conceptual model for energy system based on hydrogen storage.

Figure 4 .
Figure 4. Load profile system based on RTS system.

Figure 5 .
Figure 5. Area under curve for DBM.

Figure 6 .
Figure 6.Low chart of the DBM method.

Figure 8 .
Figure 8. Visualization of system energy outputs using DBM.

Figure 9 .
Figure 9. Cost structure of hybrid solar PV/hydrogen system).

Figure 12 .
Figure 12.Comparative analysis of energy production scenarios.

Figure 17 .
Figure 17.Comparative analysis of hybrid solar PV/WTG system.

Table 2 .
Monthly variations in temperatures associated losses in Cairo-2023.

Table 3 .
solar PV array temperature losses.

Table 4 .
Cost analysis of the system.

Table 5 .
System components specifications.

Table 6 .
Cost analysis of the system.